import 'package:flutter_09_game/utils/loading/loading_utils.dart';

import '../http_response.dart';

extension FutureExtensionLoading on Future<HttpResponse> {
  Future<HttpResponse> loading() {
    LoadingUtils.showLoading();
    return then((response) {
      LoadingUtils.dismiss();
      return Future.value(response);
    }, onError: (error) {
      LoadingUtils.dismiss();
      return Future.error(error);
    });
  }
}
